package com.entor.controller;

import java.util.List;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSON;
import com.entor.model.MembershipFee;
import com.entor.model.Msg;
import com.entor.service.BaseServiceI;
@Controller
@RequestMapping("/mfc")
public class MembershipFeeController extends BaseController<MembershipFee> {
	
	@Resource(name="membershipFeeService")
	private BaseServiceI<MembershipFee> mfbsi;
	
	@RequestMapping("/index")
	public String index() {
		return "/membershipFee/index";
	}
	
	@RequestMapping("/memberMF")
	public String member() {
		return "/membershipFee/memberMF";
	}
	
	@RequestMapping("/aoe")
	public String addOrEdit(HttpServletRequest req) throws Exception {
		String vals = req.getParameter("vals");
		if(vals!=null){
			vals = new String(vals.getBytes("iso-8859-1"),"utf-8");
			MembershipFee mf = JSON.parseObject(vals, MembershipFee.class);
			req.setAttribute("mf", mf);
		}
		return "/membershipFee/addOrEditMF";
	}
	
	@Override
	public List<MembershipFee> find(MembershipFee t) {
		return mfbsi.find(t);
	}
	
	@Override
	public Msg insert(MembershipFee t) {
		return mfbsi.insert(t);
	}
	
}
